]> dgit.raspbian.org Git - libreoffice.git/commitdiff
[PATCH] limit the gstreamer backend to simple self-contained media
authorCaolán McNamara <caolan.mcnamara@collabora.com>
Mon, 13 Jul 2026 22:42:37 +0000 (22:42 +0000)
committerRene Engelhard <rene@debian.org>
Sat, 3 Oct 2026 10:46:08 +0000 (12:46 +0200)
The adaptive-streaming cases follow a more complicated indirect route of
a manifest to further resources which is atypical for our use.

Change-Id: I1a3e51d23cc4e8e2912304d5d1c3337c71c1029e
Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Reviewed-on: https://gerrit.collaboraoffice.com/c/core/+/7008
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
(cherry picked from commit c7eada5bc2233369e196f2c93e7606b56e3acc62)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/208333
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Signed-off-by: Xisco Fauli <xiscofauli@libreoffice.org>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/208392
Reviewed-by: Hossein <hossein@libreoffice.org>
Tested-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
Gbp-Pq: Name CVE-2026-63269-1.diff

avmedia/source/gstreamer/gstplayer.cxx

index 1a91a689299e299d39b28f3cfd372185c55382da..f435bd78826b9ed02e6e9d448f910ffdae13bd28 100644 (file)
@@ -35,6 +35,7 @@
 #include <cppuhelper/supportsservice.hxx>
 #include <sal/log.hxx>
 #include <rtl/string.hxx>
+#include <o3tl/string_view.hxx>
 #include <salhelper/thread.hxx>
 #include <vcl/svapp.hxx>
 #include <vcl/syschild.hxx>
@@ -310,6 +311,38 @@ Player::Player() :
 
     mbInitialized = gst_init_check( &argc, &argv, &pError );
 
+    if (mbInitialized)
+    {
+        // Drop the "Adaptive" ones to rank none as a crude but simple way to
+        // drop the cases that take a manifest to further resources that it
+        // names. Otherwise an option is to follow more closely what browsers
+        // probably do here and register a handler for fetching data.
+        GstRegistry* pRegistry = gst_registry_get();
+        GList* pFactories = gst_registry_get_feature_list(pRegistry, GST_TYPE_ELEMENT_FACTORY);
+        for (GList* pItem = pFactories; pItem; pItem = pItem->next)
+        {
+            GstElementFactory* pFactory = GST_ELEMENT_FACTORY(pItem->data);
+            const gchar* pKlass = gst_element_factory_get_metadata(pFactory, GST_ELEMENT_METADATA_KLASS);
+            if (!pKlass)
+                continue;
+
+            OString aKlass(pKlass);
+            bool bAdaptive = false;
+            for (sal_Int32 nIndex = 0; nIndex >= 0;)
+            {
+                if (o3tl::getToken(aKlass, 0, '/', nIndex) == "Adaptive")
+                {
+                    bAdaptive = true;
+                    break;
+                }
+            }
+
+            if (bAdaptive)
+                gst_plugin_feature_set_rank(GST_PLUGIN_FEATURE(pFactory), GST_RANK_NONE);
+        }
+        gst_plugin_feature_list_free(pFactories);
+    }
+
     SAL_INFO( "avmedia.gstreamer", AVVERSION << this << " Player::Player" );
 
     if (pError != nullptr)